//
//  DCImageCache.h
//  DCWebImage
//
//  Created by Joinwe on 16/6/1.
//  Copyright © 2016年 Joinwe. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface DCImageCache : NSObject{
    NSMutableDictionary *_allCache;
}

+ (DCImageCache *)sharedImageCache;

/**
 *  从内存中查找图片
 *
 *  @param urlString 图片地址
 *
 *  @return 图片
 */
- (UIImage *)seachImageFromMemoryWithURLString:(NSString *)urlString;


/**
 *  从沙盒中查找图片
 *
 *  @param urlString 图片地址
 *
 *  @return 图片
 */
- (UIImage *)searchImageFromSandBoxWithURLString:(NSString *)urlString;

/**
 *  下载图片
 *
 *  @param urlString 图片地址
 *  @param block     回调
 */
- (void)downloadImageWithURLString:(NSString *)urlString completionBlock:(void (^)(UIImage *image))block;


/**
 *  清除图片所占磁盘空间
 */
- (void)clearDisk;



@end
